# -*- coding: utf-8 -*-
from __future__ import with_statement
import sys
import os

try:
    import netMinc
except ImportError:
    my_path = os.path.realpath(os.path.abspath(__file__))
    project_parent = os.path.dirname(os.path.dirname(os.path.dirname(my_path)))
    
    for sys_path in sys.path:
        if sys_path[-1] in ("/", "\\"):
            sys_path = sys_path[:-1]
        if os.path.basename(sys_path) == "site-packages":
            with open(sys_path + "/netMinc.pth", "wb") as fp:
                fp.write(project_parent)
            break
    sys.path.insert(0, project_parent)
    my_module = __import__("netMinc", {}, {}, [''])
    sys.modules["netMinc"] = my_module
